<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /* 
            lastIndexOf从后面往前面找元素,返回的就是找到的那个元素的下标
        */
        var arr = ["文渊", "文种", "文章","文渊", "文雯"]
        console.log("新数组", arr);
        var res = arr.lastIndexOf("文渊") //在arr这个数组当中找文渊的下标
        console.log("新数组", arr);
        console.log("返回值", res);



        var arr = [1, 2, 3, 4, 5, 6, 7, 8]
        //         0  1  2  3  4  5  6  7
        console.log("新数组", arr);
        var res = arr.slice(2, 5)    //从数组当中截取下标为2的元素到下标为3的元素(包头不包尾)
        console.log("新数组", arr);
        console.log("返回值", res);
    </script>
</body>

</html>